package com.woniuxy.controller;


import com.woniuxy.controller.form.NewVoteForm;
import com.woniuxy.controller.form.PageAllVoteForm;
import com.woniuxy.service.VoteOptionService;
import com.woniuxy.service.VoteTopicService;
import com.woniuxy.util.Result;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author zhouzhou
 * @since 2022-06-23
 */
@RestController
public class VoteTopicController {

    @Resource
    private VoteTopicService voteTopicService;

    @Resource
    private VoteOptionService voteOptionService;


    @RequestMapping("/createVote")
    public Result createVote(NewVoteForm newVoteForm) throws Exception {
        Result result = voteTopicService.createVote(newVoteForm);
        return result;
    }

    @RequestMapping("/getAllVote")
    public Result getAllVote(PageAllVoteForm pageAllVoteForm){
        Result result = voteTopicService.getAllVote(pageAllVoteForm);
        return result;
    }
}

